/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package primitive_vs_object_datatypes;

/**
 *
 * @author Iskandar Sarkawi
 */
public class Example1 {

    public static void main(String[] args){
        primitiveDataType();
        System.out.println();
        objectDataType();
    }

    private static void primitiveDataType(){
        int i = 5;
        int j = 4;

        System.out.println("Comparing using primitive data type");
        if(i==j){
            System.out.println(i + " is equals to " + j);
        }else{
            System.out.println(i + " is NOT equals to " + j);
        }
        
    }

    private static void objectDataType(){
        Integer i = new Integer(5);
        Integer j = new Integer(4);

        System.out.println("Comparing using object data type");
        if (i.equals(j)){
        System.out.println(i + " is equals to " + j);
        }else{
            System.out.println(i + " is NOT equals to " + j);
        }
    }

}
